import { init } from 'snabbdom/build/package/init'
import { h } from 'snabbdom/build/package/h'

const patch = init([])

const app = document.querySelector('#app')
let vnode = h('div#container',[
  h('h1','hello snabbdom'),
  h('p','hello snabbdom p 标签'),
])

const oldVNode = patch(app,vnode)

setTimeout(()=>{
  vnode = h('div#container',[
    h('h1','hello snabbdom 02'),
    h('p','hello snabbdom p 标签 02'),
  ])
  patch(oldVNode,vnode)
},2000)


setTimeout(()=>{
  // 清除div内的内容
  // h函数配置空的
  patch(oldVNode,h('!'))
},4000)
